<?php
abstract class Pageley_Log {

	private function __construct() { }
	
	private static function getLogger($object) {
		$logFactory = Pageley_Log_Factory::getInstance();
		return $logFactory->getLogger($object);
	}
	
	public static function isLevelEnabled($object, $level) {
		return self::getLogger($object)->isLevelEnabled($level);
	}
	
	public static function isTraceEnabled($object) {
		return self::isLevelEnabled($object, Pageley_Log_Level::$TRACE);
	}
	
	public static function isDebugEnabled($object) {
		return self::isLevelEnabled($object, Pageley_Log_Level::$DEBUG);
	}
	
	public static function isInfoEnabled($object) {
		return self::isLevelEnabled($object, Pageley_Log_Level::$INFO);
	}
	
	public static function log($object, $level, $message) {
		self::getLogger($object)->log($level, $message);
	}
	
	public static function trace($object, $message) {
		self::log($object, Pageley_Log_Level::$TRACE, $message);
	}
	
	public static function debug($object, $message) {
		self::log($object, Pageley_Log_Level::$DEBUG, $message);
	}
	
	public static function info($object, $message) {
		self::log($object, Pageley_Log_Level::$INFO, $message);
	}
	
	public static function warn($object, $message) {
		self::log($object, Pageley_Log_Level::$WARN, $message);
	}
	
	public static function error($object, $message) {
		self::log($object, Pageley_Log_Level::$ERROR, $message);
	}
	
	public static function fatal($object, $message) {
		self::log($object, Pageley_Log_Level::$FATAL, $message);
	}
}